﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderStatus.aspx.cs" Inherits="Golf.WebUI.AdminShow.BasicdataManager.OrderStatus" %>

<%@ Register Assembly="FlexiGrid" Namespace="FlexiGrid" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Script/FlexiGrid/css/contextmenu.css" rel="stylesheet" type="text/css" />
    <link href="../../Script/FlexiGrid/css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../Script/FlexiGrid/css/flexigrid.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        /**********判断是否加载jquey***************/
        window.jQuery || document.write('<script src="../../Script/jquery/jquery-1.4.1-vsdoc.js" type="text/javascript"><\/script>');
    </script>

    <script src="../../Script/ymPrompt/ymPrompt.js" type="text/javascript"></script>

    <link href="../../Script/ymPrompt/skin/bluebar/ymPrompt.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        jQuery(function() {

            //获取浏览器的高度和宽度
            var mainHeight = document.documentElement.clientHeight;
            var mainWidth = document.documentElement.clientWidth;
            //设置常用属性
            tableId = "tblStudentList";
            title = "订单状态";
            pageSize = 5;
            //width = mainWidth;
            //height = mainHeight;
            sortorder = "asc";
            width = "auto";
            height = 180;
            ajaxUrl = "../../HttpHandler/Basicdata/OrderStatus.ashx";
            //设置列名(注意：主键列不用写)
            cells = new Array(
                new cell("姓名", "UserName", 120, true, "left", null),
                new cell("邮箱", "UserEmail", 120, true, "left", null),
                new cell("邮编", "UserCode", 120, true, "left", null),
                new cell("模拟排序", "UserQQ", 120, true, "left", null)
            );
            //设置菜单按钮
            buttons = new Array(
            new button("Add", "添加", "Add"),
           new button("Delete", "删除", "Delete")
            ); 
            //设置右键菜单
            menus = new Array(
                    new rightKeyMenu("导出所有信息到Excel", "../../Script/FlexiGrid/css/images/icons/excel.jpg", "view"),
                    new rightKeyMenu("导出该信息到Excel", "../../Script/FlexiGrid/css/images/icons/excel.jpg", "Refresh")
            );
            //右键菜单事件
            menuItem_click = function(cmd, cell, id) {
                //id就是每一行数据的主键列，
                // cell是这一行数据的列的集合。
                //要取数据则为cell[索引],cmd同上
                if (cmd == "view") {
                    alert("导出所有" + id);
                }
                if (cmd == "Refresh") {
                    alert("导出当个" + id);
                }
            }
            button_click = function(cmd, grid) {
                if (cmd == "Add") {
                    ymPrompt.win({ message: '../Admin/Default.aspx', width: 600, height: 500, title: '添加', maxBtn: true, minBtn: true, iframe: true });
                }
                if (cmd == "Delete") {
                    if (confirm("你确定要删除吗？")) {
                        var chk = $("#tblStudentList input:checked");
                        var strIds = "";
                        if (chk.length == 0) {
                            alert("你需要选中后才可以删除");
                        }
                        else if (chk.length == 1) {
                            chk.each(function() {
                                strIds += chk.val();
                            });
                            $.getJSON("../../HttpHandler/Advertise_AddAD_Manage.ashx", { action: "Delete", ids: strIds }, function(ball) {
                                alert(ball);
                            });
                        }
                    }
                }
            }
            //加载FlexiGrid的方法加载数据
            flexiGridLoad();
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <cc1:FlexiGrid ID="FlexiGrid1" runat="server" />
        <div id="divStudentData">
            <div id="divStudentList">
                <table id="tblStudentList">
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
